extends ./layout/home
block title
block content
	header.detailTit.container-fluid
		.container.clearfix
			div.logo.col-4
				a(href="/")
					span 豆瓣
					span d
					span.oa o
					span.un u
					span b
					span.oa a
					span.un n
					span •
					span(style="font-size:18px;padding-right:10px;")= towTit
				a.btn.btn-default.btn-nav
					i.fa.fa-th-large
					span 导航
					span.fa.fa-caret-down
			div.search.col-5
				form.clearfix
					input.form-control.col-10(type="text",placeholder="Search in for ...")
					button.btn.btn-success.col-2 搜全网
			div.top-nav
				if user
					a#userId(href="/admin/",userId="#{user._id}",userName="#{user.username}") 欢迎您 #{user.username}
				else
					a#userId(href="/admin/login",userId=null,userName=null) 请登录!
				a(href="/admin/register") 注册
	div.container.list
		if movies && movies.length>0
			.clearfix
				each item in movies
					.col-2.item
						.thumbnail
							a(href="/detail/#{item._id}")
								img(src="#{item.poster}",alt="#{item.title}")
							.caption
								h3.cap-tit #{item.title}
								p: a.btn.btn-primary(href="/detail/#{item._id}") 观看预告片
			if totalPage != 1
				.pageBox
					- for(var i=0;i<totalPage;i++){
						- if (currentPage == (i+1)) {
							span.active #{currentPage}
						- }else{
							a(href="/list?cat=#{catId}&p=#{i}") #{i+1} 
						- }
					- }